import request from '@/utils/request'

// 组织架构的基本信息
export const reqGetDepartments = () => {
  return request({
    method: 'get',
    url: '/company/department'
  })
}

export const reqDelDepartment = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

// 新增部门
export const reqAddDepartments = (data) => {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

// 获取部门详情
export const reqGetDepartDetail = (id) => {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}
// 更新部门
export const reqUpdateDepartments = (data) => {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}
